<:!:/>

@file c.login.html
@author Alejandro Dario Simi
@date $Date: 2013-05-24 23:14:00 +0000 (Fri, 24 May 2013) $

$Id: c.login.html 66 2013-05-24 23:14:00Z daemonraco@gmail.com $
$URL: http://wcomix.googlecode.com/svn/tags/wcomix-1.0.0.2/themes/mdefault/templates/contents/c.login.html $

<::/>
<script type="text/javascript">
	function SendAuth() {
		jQuery.post('service.php?action=<:VAR:/>WC_SERVICE_LOG_IN<::/>', {
			'username':	$("#USERNAME").val(),
			'password':	$("#PASSWORD").val(),
			'keepme':	$("#KEEPME").val()
		}, function(data){
			var	xml = $($.parseXML(data));
			if(xml.find("wc-success").length) {
				GoMenu();
			} else if(xml.find("wc-failed").length) {
				var	error = "";
				if(xml.find("wc-error>wc-code").length) {
					error = xml.find("wc-error>wc-code").text() + ": ";
				}
				error = error + xml.find("wc-error>wc-message").text();

				alert(error);
			}
			$("#USERNAME").focus();
		});
	}
	function GoMenu() {
		document.location.href = "?action=<:VAR:/>WC_ACTION_MENU<::/>&group=<:VAR:/>GROUP-ID<::/>";
	}
</script>

<style type="text/css">
	form.Form, form.Form table, form.Form table tr, form.Form table tr td input {
		width: 100%;
	}
</style>

<div class="ListViewSection">Login</div>
<div class="ListView">
	<div class="ListItem">
		<div>Username:</div>
		<div><input type="text" id="USERNAME" value=""/></div>
	</div>
	<div class="ListItem">
		<div>Password:</div>
		<div><input type="password" id="PASSWORD" value=""/></div>
	</div>
	<div class="ListItem">
		<div>Remember me:</div>
		<div><select id="KEEPME">
			<option value="Y" selected="selected">Yes</option>
			<option value="N">No</option>
		</select></div>
	</div>
	<div class="ListItem">
		<div style="vertical-align:top;">&nbsp;</div>
		<div><form class="Form" action="#" onsubmit="SendAuth();return false;">
			<table><tr>
				<td style="width:50%;">
					<input type="submit" value="Login"/>
				</td><td>
					<input type="submit" value="Cancel" onclick="GoMenu();return false;"/>
				</td>
			</tr></table>
		</form></div>
	</div>
</div>
